const { Schema,model} = require('mongoose');
const moment = require('moment');
//设置理赔集合
const lipeiSchema = new Schema({
    clientName:String,              //客户名称
    insuranceName:String,           //保险名称
    insurancePirce:String,         //保险价格
    imgname:String,             //凭证
    payment:String,             //赔付金额
    reason:String,               //理赔描述      
    salesId:{
        type: Schema.Types.ObjectId,  // mongoose 中 _id 属性的类型
        ref: 'Sales'  // 指定关联集合的模型名称
    },
    
    time:{
        type:String,
        default:moment().format('YYYY年MM月DD日')
    },
    status:{
        type:String,
        default:"未受理"
    },
},{versionKey:false});

const Lipei = model('Lipei',lipeiSchema,'lipei');

module.exports.Lipei = Lipei;